﻿using Architecture.Repository;
using Architecture.Repository.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Architecture.Domain.Service.CountyService
{
    public class CountyService :  ICountyService
    {
        /// <summary>
        /// 县数据服务
        /// </summary>
        protected readonly ICountryRepository _countryRepository;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="countryRepository">县数据服务</param>
        public CountyService(ICountryRepository countryRepository)
        {
            _countryRepository = countryRepository;
        }

        public async Task<List<County>> GetAllCounties(int cityId)
        {
            return await _countryRepository.GetAsync(x=>x.CityId==cityId);
        }
    }
}
